"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import IndexViews,UsersViews,TypesViews,GoodsViews,OrderViews,authViews
urlpatterns = [
# 首页显示
    url(r'^$', IndexViews.index, name='admin_index'),
#登录 页面
    url(r'^admin/login',authViews.my_login,name='admin_login'),
    # 退出
    url(r'^admin/logout',authViews.my_logout,name='admin_logout'),

# 会员管理
    # 显示会员添加页面
    url(r'^user/add/',UsersViews.user_add,name='admin_user_add'),
    # 表单数据插入数据库
    url(r'^user/insert/',UsersViews.user_insert,name='admin_user_insert'),
    # 显示用户列表
    url(r'^user/list/',UsersViews.user_list,name='admin_user_list'),
    # 删除用户
    url(r'^user/del/',UsersViews.user_del,name='admin_user_del'),
    # 修改用户页面
    url(r'^user/uppage/(?P<uid>[0-9]+)/',UsersViews.user_uppage,name='admin_user_uppage'),
    # 更新修改页面数据
    url(r'^user/upinsert/',UsersViews.user_upinsert,name='admin_user_upinsert'),


# 分类管理
    # 显示添加分类页面
    url(r'^types/add/',TypesViews.types_add,name='admin_types_add'),
    # 添加数据
    url(r'^types/insert/',TypesViews.types_insert,name='admin_types_insert' ),
    # 分类列表
    url(r'^types/list/',TypesViews.types_list,name='admin_types_list'),
    # 删除分类
    url(r'^types/delete/',TypesViews.types_delete,name='admin_types_delete'),
    # 修改类名
    url(r'^types/upname/',TypesViews.types_upname,name='admin_types_upname'),

#  商品管理
    # 商品添加显示页面
    url(r'^goods/add/',GoodsViews.goods_add,name='admin_goods_add'),
    #  执行商品添加
    url(r'^goods/insert/',GoodsViews.goods_insert,name='admin_goods_insert'),
    # 商品列表
    url(r'^goods/list/',GoodsViews.goods_list,name='admin_goods_list'),
    # 删除
    url(r'^goods/del/',GoodsViews.goods_del,name='admin_goods_del'),
    # 修改
    url(r'^goods/uppage/',GoodsViews.goods_uppage,name='admin_goods_uppage'),
    # 执行修改
    url(r'^goods/upinsert/',GoodsViews.goods_upinsert,name='admin_goods_upinsert'),

# 订单管理
    # 订单列表页面
    url(r'^order/list/',OrderViews.order_list,name='admin_order_list'),
    # 查看订单详情
    url(r'^order/info/',OrderViews.order_info,name='admin_order_info'),

# auth 权限认证
    # 管理员添加
    url(r'^auth/user/add/',authViews.auth_user_add,name='auth_user_add'),
    # 管理员列表
    url(r'^auth/user/list/',authViews.auth_user_list,name='auth_user_list'),
    # 删除管理员
    url(r'^auth/user/del/(?P<uid>[0-9]+)/',authViews.auth_user_del,name='auth_user_del'),
# 后台组添加
    url(r'^auth/group/add/',authViews.auth_group_add,name='auth_group_add'),
    # 后台组列表
    url(r'^auth/group/list$',authViews.auth_group_list,name='auth_group_list'),
    # 组的编辑
    url(r'^auth/group/edit/(?P<gid>[0-9]+)$',authViews.groupedit,name='auth_group_edit'),


 ]
